﻿#region GNU General Public License
// XEdit2D - XNA 2D Asset Editor
// Copyright (C) 2010  HurlBat Games

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
#endregion

using System.Collections.Generic;

namespace HurlBat.Data2D.Map
{
    public class Map
    {
        string name = string.Empty;
        /// <summary>
        /// The name of this map
        /// </summary>
        public string Name { get { return name; } set { name = value; } }

        string description = string.Empty;
        /// <summary>
        /// The description of this map
        /// </summary>
        public string Description { get { return description; } set { description = value; } }

        int width;
        /// <summary>
        /// The width in number of tiles
        /// </summary>
        public int Width { get { return width; } set { width = value; } }

        int height;
        /// <summary>
        /// The height in number of tiles
        /// </summary>
        public int Height { get { return height; } set { height = value; } }

        TileSet tileSet = new TileSet();
        /// <summary>
        /// The complete set of tiles to be used in this map
        /// </summary>
        public TileSet TileSet { get { return tileSet; } set { tileSet = value; } }

        Tile[,] baseLayer;
        /// <summary>
        /// The base layer used for the map
        /// </summary>
        public Tile[,] BaseLayer { get { return baseLayer; } set { baseLayer = value; } }

        List<TileEntry> overLayers;
        /// <summary>
        /// All possible tiles that come on top of the base layer
        /// </summary>
        public List<TileEntry> OverLayers { get { return overLayers; } set { overLayers = value; } }

        Road[,] roads;
        /// <summary>
        /// The definition of roads for the map
        /// </summary>
        public Road[,] Roads { get { return roads; } set { roads = value; } }

        List<MapObject> objects;
        /// <summary>
        /// The collection of map objects
        /// </summary>
        public List<MapObject> Objects { get { return objects; } set { objects = value; } }

        public void New(int width, int height)
        {
            this.width = width;
            this.height = height;

            this.baseLayer = new Tile[this.width, this.height];
            this.overLayers = new List<TileEntry>();
            this.objects = new List<MapObject>();
        }
    }
}
